<template>
	<view class="detils">
		<p-navbar title="策略详情"></p-navbar>
		<view class="detils-title">
			<view class="detils-flex">
				<view class="detils-h1">
					网格交易看涨版（版本1.0）
					<text class="detils-text">现货</text>
				</view>
				<view class="detils-text">
					剩余可售13单
				</view>
			</view>
			<view class="detils-text">
				策略编码：V2JHYJ
			</view>
			<view class="detils-text">
				震荡看涨 赚币待涨
			</view>
			<view class="format">
				<view class="format-display" v-for="(item,index) in strtagy" :key="index">
					<view class="format-value">{{item.key}}</view>
					<view class="detils-text">{{item.name}}</view>
				</view>
			</view>
		</view>
		<!-- 内容 -->
		<view class="detils-center">
			<view class="swiperes" >
				<view v-for="(item,index) in center" class="swiperes-itemes" :class="centerindex==index?'swiperes-show':''" :key="index" @tap="getswiper(item,index)">
					{{item}}
				</view>
			</view>
			<!-- swiper -->
			<swiper :current="centerindex" @animationfinish="animationfinish" style="height: 750rpx;">
				<!-- 全部 -->
				<swiper-item class="swiper-item">
					<scroll-view scroll-y="true" class="scroll-y" @scrolltolower="scrolltolower">
						<view>先买后卖  本币交易 趋势看涨 利润更大</view>
					</scroll-view>
				</swiper-item>
				<!-- 现货 -->
				<swiper-item  class="swiper-item">
					<scroll-view scroll-y="true" class="scroll-y" @scrolltolower="scrolltolower">
					<view v-for="(items,indexs) in proxy" :key="indexs">
						<!-- 概况 -->
						<view class="scroll-title">{{items.Overview}}</view>
						<view class="" v-for="(item,index) in items.Overchild" :key="index">
							<view class="scroll-flex">
								<view class="scroll-name">
									{{item.Overviewname}}
								</view>
								<view class="scroll-value">
									{{item.key}}
								</view>
							</view>
						</view>
						<!-- 账户 -->
						<view class="scroll-title">{{items.Account}}</view>
						<view class="" v-for="(item,index) in items.Accountchild" :key="index+'1'">
							<view class="scroll-flex">
								<view class="scroll-name">
									{{item.Accountname}}
								</view>
								<view class="scroll-value">
									{{item.key}}
								</view>
							</view>
						</view>
						<!-- 账户 -->
						<view class="scroll-title">{{items.parameter}}</view>
						<view class="" v-for="(item,index) in items.parameterchild" :key="index+'2'">
							<view class="scroll-flex">
								<view class="scroll-name">
									{{item.parametername}}
								</view>
								<view class="scroll-value">
									{{item.key}}
								</view>
							</view>
						</view>
						<!-- 账户 -->
						<view class="scroll-title">{{items.version}}</view>
						<view class="" v-for="(item,index) in items.versionchild" :key="index+'3'">
							<view class="scroll-flex">
								<view class="scroll-value">
									{{item.versionname1}}
								</view>
								<view class="scroll-value">
									{{item.versionname2}}
								</view>
								<view class="scroll-value">
									{{item.versionname3}}
								</view>
							</view>
						</view>
						<!-- 账户 -->
						<view class="scroll-title">{{items.Details}}</view>
						<view class="" v-for="(item,index) in items.Detailschild" :key="index+'4'">
							<view class="scroll-flex" style="border: none;">
								<view class="scroll-name" style="line-height: 40rpx;text-indent: 2em;">
									{{item}}
								</view>
							</view>
						</view>
					</view>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				center:['介绍','概况'],
				centerindex:1,//下标
				strtagy:[
					{
						key:'0.0000 BTC',
						name:'累计投入'
					},
					{
						key:'0.0000 BTC',
						name:'累计收益'
					},
					{
						key:'0.00%',
						name:'预期年化'
					},
					],
				proxy:[
					{
						Overview:'概况',
						Overchild:[
							{
								Overviewname:'利润更大',
								key:'V2F6YQ'
							},
							{
								Overviewname:'类型',
								key:'现货'
							},
							{
								Overviewname:'单币种投入限制',
								key:'价值 20000 USDT'
							},
							{
								Overviewname:'API数量',
								key:'1个'
							},
							{
								Overviewname:'投入币种数量',
								key:'1~2个'
							},
							{
								Overviewname:'参数数量',
								key:'2个'
							}
						],
						Account:'账户',
						Accountchild:[
							{
								Accountname:'交易所限制',
								key:'无'
							},
							{
								Accountname:'投入类型',
								key:'交易币可投入'
							},
							{
								Accountname:'是否指定交易对',
								key:'否'
							},
							{
								Accountname:'说明',
								key:'无'
							}
						],
						parameter:'参数',
						parameterchild:[
							{
								parametername:'单格盈利率',
								key:'无'
							},
							{
								parametername:'网格间隔',
								key:'无'
							},
							{
								parametername:'网格数量',
								key:'无'
							},
							{
								parametername:'最大挂单数',
								key:'无'
							},
							{
								parametername:'价格上限',
								key:'无'
							},
							{
								parametername:'价格下限',
								key:'无'
							},
							{
								parametername:'单向手续费',
								key:'无'
							}
						],
						version:'版本',
						versionchild:[
							{
								versionname1:'版本1.0',
								versionname2:'策略发布',
								versionname3:'2020/08/07 14:10',
							}
						],
						Details:'版本',
						Detailschild:['策略商城提供第三方的策略展示和购买，请您确认在购买前已充分理解买卖自负的市场原则，充分认识到策略交易潜在的交易风险，自行承担交易结果。任何策略都不能保证其在未来的正盈利性，过往数据不预示未来表现，相关数据仅提供参考，不构成投资建议。任何由于购买的量化策 略带来资金缩水或损失风险，本平台不担负任何责任，请您谨慎选择，合理投资。']
					}
				]
			};
		},
		methods:{
			// 由于swiper的内部机制问题，快速切换swiper不会触发dx的连续变化，需要在结束时重置状态
			// swiper滑动结束，分别设置tabs和swiper的状态
			animationfinish(e) {
				this.centerindex =  e.detail.current;
			},
			getswiper(item, index){//swipeer切换
				this.centerindex = index//标题切换
			},
			scrolltolower(){
				console.log('下拉')
			},
		}
	}
</script>

<style lang="scss">
.detils{
	margin: 20rpx;
}
.detils-title{
	background-color: $color-bg;
	border-radius: 16rpx;
	padding: 20rpx;
	margin-top: 20rpx;
	.detils-flex{
		@include flex;
		justify-content: space-between;
		.detils-h1{
			font-size: 32rpx;
			font-weight: bold;
		}
	}
	.format{
		padding-top: 10rpx;
		@include flex;
		justify-content: space-between;
		.format-display:nth-child(3){
			text-align: right;
		}
		.format-value{
			font-weight: bold;
			font-size: 30rpx;
		}
	}
}
.detils-text{
	font-size: 24rpx;
	color: $color-fu;
	font-weight: 100;
	line-height: 50rpx;
}
.swiperes{
		// padding: 40rpx 10rpx 0rpx;
		@include flex;
		.swiperes-itemes{
			padding-right: 30rpx;
			color: $color-fu;
			font-size: 28rpx;
		}
		.swiperes-show{
			color: $light-color;
			font-size: 34rpx;
			font-weight: bold;
			// transition: 1s;
		}
}
.detils-center{
	background-color: #FFFFFF;
	margin-top: 40rpx;
	border-radius: 16rpx;
	padding: 30rpx 20rpx;
}	
.swiper-item{
		// min-height: 500rpx;
		margin-top: 20rpx;
		.scroll-y{
			height: 730rpx;
		}
}
.scroll-title{
	font-size: 32rpx;
	color: #000000;
	font-weight: bold;
	margin: 20rpx 0rpx 20rpx;
}
.scroll-flex{
	@include flex;
	justify-content: space-between;
	line-height: 80rpx;
	border-bottom: 1rpx solid $border;
	.scroll-name{
		font-size: 24rpx;
		color: $color-fu;
	}
	.scroll-value{
		font-size: 28rpx;
	}
}
</style>
